﻿@model GameSchool.Models.StudentHomeViewModel

@{
    ViewBag.Title = "Student Home | GameSchool";
    Layout = "~/Views/Shared/_LayoutStudent.cshtml";
}
    
    <div class="mainSectionStuff">
        <h2>Upcoming Deadlines</h2>       
        <ul class="deadLinesList">
            @foreach (var item in Model.deadlines)
            {    
                <li class="deadlineLI"> @item.courseName</li>
                <li>@item.taskType (Level: @item.level.AsInt()) | Days left: @item.daysLeft</li>
            } 
        </ul>
    </div>

        <div class="mainSectionStuff">
        <h2>Overview of your courses</h2>        
        @foreach (var item in Model.studentProgressDashboard)
        {
            <table class="studentProgressTable">
                <caption>@item.courseName</caption>
                <thead>
                    <tr>		                
                        <th class="scoreBelow">Student below</th>                        
		                <th class="scoreYour">Your Score</th>
		                <th class="scoreAbove">Student above</th>
	                </tr>
                </thead>
                <tbody>
	                <tr>
                        @if (item.xpAboveStudent == 0)
                        { 
                            <td class="scoreBelow">@item.xpBelowStudent XP</td>                        
		                    <td class="scoreYour">@item.currentXPInCourse XP</td>
		                    <td class="scoreAbove">-</td>
                        }
                        else if (item.xpBelowStudent == 0)
                        { 
                            <td class="scoreBelow">-</td>                        
		                    <td class="scoreYour">@item.currentXPInCourse XP</td>
		                    <td class="scoreAbove">@item.xpAboveStudent XP</td>
                        }
                        else
                        {    
                            <td class="scoreBelow">@item.xpBelowStudent XP</td>                        
		                    <td class="scoreYour">@item.currentXPInCourse XP</td>
		                    <td class="scoreAbove">@item.xpAboveStudent XP</td>
                        }
            	    </tr>
                </tbody>	
        </table>   
        <div class="levelIndicator">            
            <p>I've completed <span class="myLevels">@item.currentLevelInCourse</span> levels 
               out of <span class="totalLevels">@item.totalLevelsInCourse</span></p>
        </div>
        }        
    </div>

    <div class="mainSectionStuff">               
        <h2>Latest Achievements</h2>
        <ul>
            @foreach (var item in Model.listAchievements)
            {
                if (@item.achievementID == 1)
                {
                    <li>Achievement Name: @item.title<img src="http://stickers.classroomcapers.co.uk/catalog/product/cache/1/image/265x265/5e06319eda06f020e43594a9c230972d/T/1/T11013LRG.jpg" alt="prize" width="200px" height="200px"/> </li>
                }
                else if (@item.achievementID == 2)
                {
                    <li>Achievement Name: @item.title <img src="http://casualgamerchick.com/wp-content/uploads/2007/06/achievement.jpg" alt="prize" width="200px" height="200px" /> </li>
                }
                else if (@item.achievementID == 3)
                {
                    <li>Achievement Name: @item.title <img src="http://us.123rf.com/400wm/400/400/snake3d/snake3d1108/snake3d110800018/10375234-golden-medal-first-place-award-champion-winner-achievement-pride-badge-design-element-the-best-numbe.jpg" alt="prize" width="200px" height="200px" /> </li>
                }
                else
                { @* default achievement image *@
                    <li>Achievement Name: @item.title <img src="http://us.cdn3.123rf.com/168nwm/snake3d/snake3d1108/snake3d110800038/10444977-golden-award-first-place-medal-badge-winner-achievement-pride-symbol-number-one-quality-success-conc.jpg" alt="prize" width="200px" height="200px" /> </li>
                }
            }
        </ul>    
    </div>

<ul>   
    @section menu{
        <li>@Html.ActionLink("Courses Overview", "StudentHome", "Student")</li> 
    }
</ul> 